﻿using FingerTip.Infrastructure.Configuration;
using FingerTip.Infrastructure.HttpClient;

namespace FingerTip.UnitTest.HttpClient
{
    public class ProjectClient : BaseClient
    {
        public override string HostUrl { get; } = AppSettings.Instance.GetConfig("GitLab:Host");

        public override string Token { get; } = AppSettings.Instance.GetConfig("GitLab:Token");

        public override string Version { get; }

        public ProjectClient() : base() { }

        public ProjectClient(string hostUrl,string token,string version) : base(hostUrl,token,version)
        {
            HostUrl = hostUrl;
            Token = token;
            Version = version;
        }


        public Project this[int id] => Api.Get().To<Project>("/" + id);

        public Project this[long id] => Api.Get().To<Project>("/" + id);


        public Project Create(ProjectCreate project)
        {
            return Api.Post().With(project).To<Project>("/");
        }

        public bool Delete(int id)
        {
            return Api.Delete().To<bool>("/" + id);
        }
    }

    public class ProjectCreate
    {
    }

    public class Project
    {

    }
}
